﻿using Architecture.Domain.Service;
using Architeture.Domain;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler
{
    public class RoleSetCommandHandler : IRequestHandler<RoleSetCommand, RoleInfo>
    {
        private readonly IRoleService roleService;

        public RoleSetCommandHandler(IRoleService roleService)
        {
            this.roleService = roleService;
        }

        public async Task<RoleInfo> Handle(RoleSetCommand request, CancellationToken cancellationToken)
        {
            return await roleService.RoleGetById(request.Rid);
        }
    }
}
